<%--***************************************
*
*网银在线
* 
***************************************--%>
<%@ page import="
	java.util.*,
	java.text.*,
	com.probiz.estore.common.model.order.SalesOrder,
	com.probiz.estore.common.model.system.PaymentGateway,
	com.probiz.estore.system.util.TranslateService,
	com.probiz.estore.common.helper.ConfigUtil"
	contentType="text/html; charset=UTF-8"%>
	
<%
	SalesOrder salesOrder = (SalesOrder) request.getAttribute("salesOrder");
	PaymentGateway paymentGateway = (PaymentGateway) request.getAttribute("paymentGateway");
	request.setAttribute("paymentGateway",paymentGateway);
	HashMap paramMap = paymentGateway.getConfigData();
	
	//-----------------------start: 账户信息------------------------------------------
	String v_mid ="";
	String v_moneytype="";
	String key="";
	if (paramMap != null) {
		v_mid = paramMap.get("v_mid").toString().trim(); 					//商户号
		key = paramMap.get("key").toString().trim(); 						//MD5密钥
		v_moneytype = paramMap.get("v_moneytype").toString().trim(); 		//币种
	}
	//-----------------------end:   账户信息------------------------------------------
	
	//-----------------------start: 配置信息------------------------------------------
	String returnUrl = ConfigUtil.getInstance().getStoreFrontSiteUrl()	+ "/system/payment/chinabank_response.html"; //通知接收URL
	
	//-----------------------end:   配置信息------------------------------------------
	
	//-----------------------start: 业务信息------------------------------------------
	String orderNo = salesOrder.getOrderNo();  											//订单号
	String amount = new DecimalFormat("0.00").format(salesOrder.getUnPaidAmount());		//支付金额
	String originalText = amount + v_moneytype+ orderNo + v_mid + returnUrl + key;		// 拼凑加密串
	String v_md5info=TranslateService.md5Translate(originalText).toUpperCase();			// 对拼凑串MD5私钥加密后的值 网银支付平台对MD5值只认大写字符串，所以小写的MD5值得转换为大写
	//-----------------------end:	 业务信息------------------------------------------

	
%>

	
<div style="display:none;">
	<form name="paymentGatewayForm" method="post" action="https://pay3.chinabank.com.cn/PayGate?encoding=UTF-8">
		<!--以下几项为网上支付重要信息，信息必须正确无误，信息会影响支付进行！-->
		<input name="v_mid" type="hidden" value="<%=v_mid%>">
		<input name="v_oid" type="hidden" value="<%=orderNo%>" >
		<input name="v_amount" type="hidden" value="<%=amount%>">
		<input name="v_moneytype" type="hidden" value="<%=v_moneytype%>">
		<input name="v_url" type="hidden" value="<%=returnUrl%>" >
	    <input name="v_md5info" type="hidden" value="<%=v_md5info%>">
	    
	    <!--以下几项项为网上支付完成后，随支付反馈信息一同传给信息接收页，在传输过程中内容不会改变,如：Receive.asp -->
		<input name="remark1" type="hidden" value="">
		<input name="remark2" type="hidden" value="">
		
		<!--以下几项与网上支付货款无关，只是用来记录客户信息，可以不用，使用和不使用都不影响支付 -->
		<input name="v_rcvname" type="hidden" value="${salesOrder.orderAddress.firstname}">
		<input name="v_rcvaddr" type="hidden" value="${salesOrder.orderAddress.address1}">
		<input name="v_rcvtel" type="hidden" value="${salesOrder.orderAddress.phoneNumber}">
		<input name="v_rcvpost" type="hidden" value="${salesOrder.orderAddress.postalcode}">	
		
		<input name="v_ordername" type="hidden" value="${salesOrder.customerUsername}" >
		<input name="v_orderemail" type="hidden" value="${salesOrder.customerEmail}">
    </form> 
</div>	
<script type="text/javascript">
$j(document).ready(function () {
	document.forms["paymentGatewayForm"].submit();
});
</script>
<%@ include file="./include/payOrderTips.jspf" %>